******************************************
**** Empathy Project Lucid Sample 2022 ***
******************************************

* Fielded 4/1/2022 - 4/6/2022
* Nathan Brophy and Kevin Mullinix 2023
* File last updated: 7/25/2023

* Stata 17 SE packages used: 
* estout from http://fmwww.bc.edu/repec/bocode/e
* asdoc from http://fmwww.bc.edu/repec/bocode/a
* grc1leg from https://www.stata.com/statalist/archive/2003-06/msg00348.html
* interflex from https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2739221

*Clear Stata
clear

*Use data file: "Lucid2022_Dataverse.dta"

***********************
*VARIABLE PREPARATION *
***********************

*** Empathy Measures

*To what extent do you agree or disagree with the following statements (1 disagree to 4 agree)

*Higher values = higher emapthy

*Q123 Friends usually talk to me about their problems as they say that I am very understanding.
tab Q123
gen emp1 = Q123
tab emp1

*Q124 Friendships and relationships are just too difficult, so I tend not to bother with them.
tab Q124
gen emp2 = 5-Q124
tab emp2

*Q125 I am quick to spot when someone in a group is feeling awkward or uncomfortable.
tab Q125
gen emp3 = Q125
tab emp3

*Q126 I can tell if someone is masking their true emotion.
tab Q126
gen emp4 = Q126
tab emp4

*Q127 People sometimes tell me that I have gone too far with teasing.
tab Q127
gen emp5 = 5-Q127
tab emp5

*Q128 I often find it difficult to judge if something is rude or polite.
tab Q128
gen emp6 = 5-Q128
tab emp6

*Empathy index
gen empadd=emp1+emp2+emp3+emp4+emp5+emp6
tab empadd

gen empavg=empadd/6
tab empavg

egen empstd = std(empavg)
tab empstd


*** Demographics

*Partisanship 
* Q10 Generally speaking, do you think of yourself as a Republican, Democrat, Independent, or what?
* Republican  (1) 
* Democrat  (2) 
* Independent  (3) 
* Other party (specify)  (4) 

* Q11 Would you call yourself a strong Democrat or not a very strong Democrat?
* Strong  (1) 
* Not very strong  (2) 

* Q12 Would you call yourself a strong Republican or not a very strong   Republican?
* Strong  (1) 
* Not very strong  (2) 

* Q13 Do you think of yourself as closer to the Republican Party or the Democratic Party?
* Closer to Republican  (1) 
* Neither  (2) 
* Closer to Democratic  (3) 

tab Q10
tab Q11
tab Q12
tab Q13

gen party7=.
replace party=1 if Q11==1
replace party=2 if Q11==2
replace party=3 if Q13==3
replace party=4 if Q13==2
replace party=5 if Q13==1
replace party=6 if Q12==2
replace party=7 if Q12==1
tab party7

gen party2=.
replace party2=0 if party7==1
replace party2=0 if party7==2
replace party2=0 if party7==3
replace party2=1 if party7==5
replace party2=1 if party7==6
replace party2=1 if party7==7
tab party2
label define party2 0 "Democrat" 1 "Republican"
label values party2 party2
tab party2

gen party3=.
replace party3=0 if party7==1
replace party3=0 if party7==2
replace party3=0 if party7==3
replace party3=1 if party7==4
replace party3=2 if party7==5
replace party3=2 if party7==6
replace party3=2 if party7==7
tab party3
label define party3 0 "Democrat" 1 "Independent" 2 "Republican"
label values party3 party3
tab party3


* Race
* Q7 What is your race? Check all that apply. 
* White/Caucasian  (1) 
* Black/African American  (2) 
* American Indian or Alaska Native  (3) 
* Asian/Asian-American  (4) 
* Native Hawaiian or Pacific Islander  (5) 
* Hispanic or Latino  (6) 
* Other (please specify)  (7) 
tab Q7

* 3 category race: white (0), black (1), other (3)
gen race5 =.
replace race5 = 0 if Q7=="1" //white
replace race5 = 1 if Q7=="2" //black 
replace race5 = 2 if Q7=="4" //asian 
replace race5 = 3 if Q7=="6" //hispanic or latino 
replace race5 = 4 if Q7=="1,2"
replace race5 = 4 if Q7=="1,2,3"
replace race5 = 4 if Q7=="1,2,3,4,6"
replace race5 = 4 if Q7=="1,2,3,7"
replace race5 = 4 if Q7=="1,2,6"
replace race5 = 4 if Q7=="1,3"
replace race5 = 4 if Q7=="1,3,6"
replace race5 = 4 if Q7=="1,3,7"
replace race5 = 4 if Q7=="1,4"
replace race5 = 4 if Q7=="1,5,7"
replace race5 = 4 if Q7=="1,6"
replace race5 = 4 if Q7=="1,7"
replace race5 = 4 if Q7=="2,3"
replace race5 = 4 if Q7=="2,3,4"
replace race5 = 4 if Q7=="2,3,6"
replace race5 = 4 if Q7=="2,4"
replace race5 = 4 if Q7=="2,5,6"
replace race5 = 4 if Q7=="2,6"
replace race5 = 4 if Q7=="2,7"
replace race5 = 4 if Q7=="3"
replace race5 = 4 if Q7=="3,6"
replace race5 = 4 if Q7=="5"
replace race5 = 4 if Q7=="5,6"
replace race5 = 4 if Q7=="7"
tab race5
tab race5
label define race5 0 "Non-Hispanic White" 1 "Non-Hispanic Black" 2 "Asian" 3 "Hispanic or Latino only" 4 "All other"
label values race5 race5 
tab race5

*Gender
*Q8 Do you currently describe yourself as male, female, or transgender?
*1 male, 2 female, transgender, 3 self describe
tab Q8
gen gender1=.
replace gender1=1 if Q8==1
replace gender1=2 if Q8==2
replace gender1=3 if Q8==3
replace gender1=3 if Q8==4
tab gender1

*Education
*Q4 What is the highest level of education you have completed?
tab Q4
gen edu=Q4
tab edu

*Income
*Q5 Last year (2020), what was your total family income from all sources, before taxes? 
tab Q5
gen income=Q5
tab income

*Age
*Q6 What is your age in years?
tab Q6
gen age1=Q6
replace age1=. if Q6==999
tab age1

*Religiosity
* Q122 Lots of things come up that keep people from attending religious services even if they want to. Aside from weddings and funerals, how often do you attend religious services?
* Never  (1) 
* Seldom  (2) 
* A few times a year  (3) 
* Once or twice a month  (4) 
* Once a week  (5) 
* More than once a week  (6) 
tab Q122
gen religious = Q122

*Ideology
* Q121 How would you describe your political views?
* Extremely liberal  (1) 
* Liberal  (2) 
* Somewhat liberal  (3) 
* Moderate  (4) 
* Somewhat conservative  (5) 
* Conservative  (6) 
* Extremely conservative  (7) 
tab Q121
gen ideo7 = Q121
tab ideo7

gen ideo2 = . 
replace ideo2=0 if ideo7==1
replace ideo2=0 if ideo7==2
replace ideo2=0 if ideo7==3
replace ideo2=1 if ideo7==5
replace ideo2=1 if ideo7==6
replace ideo2=1 if ideo7==7
tab ideo2
label define ideo2 0 "Liberal" 1 "Conservative"
label values ideo2 ideo2
tab ideo2

gen ideo3 = . 
replace ideo3=0 if ideo7==1
replace ideo3=0 if ideo7==2
replace ideo3=0 if ideo7==3
replace ideo3=1 if ideo7==4
replace ideo3=2 if ideo7==5
replace ideo3=2 if ideo7==6
replace ideo3=2 if ideo7==7
tab ideo3
label define ideo3 0 "Liberal" 1 "Moderate" 2 "Conservative"
label values ideo3 ideo3
tab ideo3


* Political Knowledge
* Q116 What job or political office does Mitch McConnell now hold?
* 2 is correct
tab Q116
gen pk1=.
replace pk1=1 if Q116==2
replace pk1=0 if Q116==1
replace pk1=0 if Q116==3
replace pk1=0 if Q116==4
replace pk1=0 if Q116==5
tab pk1

* Q117 What job or political office does Antony Blinken now hold?
* 4 is correct
tab Q117
gen pk2=.
replace pk2=1 if Q117==4
replace pk2=0 if Q117==1
replace pk2=0 if Q117==2
replace pk2=0 if Q117==3
replace pk2=0 if Q117==5
tab pk2

* Q118 Which political party controls the U.S. House of Representatives?
* 2 is correct
tab Q118
gen pk3=.
replace pk3=1 if Q118==2
replace pk3=0 if Q118==1
replace pk3=0 if Q118==3
tab pk3

* Q119 Who is the current Prime Minister of the United Kingdom?
* 2 is correct
tab Q119
gen pk4=. 
replace pk4=1 if Q119==2
replace pk4=0 if Q119==1
replace pk4=0 if Q119==3
replace pk4=0 if Q119==4
tab pk4

* Q120 Who is the President of Egypt?
* 1 is correct
tab Q120
gen pk5=.
replace pk5=1 if Q120==1
replace pk5=0 if Q120==2
replace pk5=0 if Q120==3
replace pk5=0 if Q120==4
tab pk5

gen pk=pk1+pk2+pk3+pk4+pk5
tab pk

* Racial resentment 
* Q133_1 Irish, Italian, Jewish, and many other minority groups overcame prejudice and worked their way up. Black people should do the same without any special favors. 
* (1) Strongly disagree - (7) strongly agree
tab Q133_1
gen resent1 = Q133_1

* Q133_2 Generations of slavery and discrimination have created conditions that make it difficult for black people to work their way out of the lower class 
* (1) strongly disagree - (7) strongly agree

tab Q133_2
gen resent2 = Q133_2
gen revresent2 = 8-Q133_2
tab revresent2

*Q133_3 Over the past few years, black people have gotten less than they deserve 
* (1) strongly disagree - (7) strongly agree
tab Q133_3
gen resent3 = Q133_3
gen revresent3 = 8-Q133_3
tab revresent3

*Q133_4 It's really only a matter of some people not trying hard enough; if black people would only try harder they could be just as well-off as whites 
* (1) strongly disagree - (7) strongly agree
tab Q133_4
gen resent4 = Q133_4

gen resentment = resent1+revresent2+revresent3+resent4

gen resentment_std = ((resentment/4)-1)/6 //standardizing the additive index so values are between 0 and 1. 0 = less resentment, 1 = more resentment.

*Military Service
* Q131 Are you now serving, have previously served, or have never served in the U.S. armed forces? Select all that apply.
* Now serving on active duty in the U.S. Air Force, Army, Coast Guard, Marine Corps, or Navy  (1) 
* Now serving in the National Guard or Reserve  (2) 
* Previously served on active duty in the U.S. Air Force, Army, Coast Guard, Marine Corps, or Navy  (3) 
* Previously served in the National Guard or Reserve  (4) 
* I have never served in the U.S. military  (5) 
tab Q131

* Dummy classification: Actively serving/have served (0), no service (1)
gen military=. 
replace military = 0 if Q131=="1"
replace military = 0 if Q131=="1,2"
replace military = 0 if Q131=="1,2,3"
replace military = 0 if Q131=="1,2,3,4"
replace military = 0 if Q131=="1,2,4"
replace military = 0 if Q131=="1,3"
replace military = 0 if Q131=="1,3,4"
replace military = 0 if Q131=="1,4"
replace military = 0 if Q131=="2"
replace military = 0 if Q131=="2,3"
replace military = 0 if Q131=="2,4"
replace military = 0 if Q131=="3"
replace military = 0 if Q131=="3,4"
replace military = 0 if Q131=="4"
replace military = 1 if Q131=="5"
tab military
label define military 0 "Have served" 1"Never served"
label values military military 
tab military


* Experimental condition for narrative groups

* Randomizer variable = FL_38_DO
tab FL_38_DO

gen nargroup=.
replace nargroup=0 if FL_38_DO == "AfricaControl"
replace nargroup=1 if FL_38_DO == "AfricaGen"
replace nargroup=2 if FL_38_DO == "AfricaNarr"
replace nargroup=3 if FL_38_DO == "AfricaNarrGen"
replace nargroup=4 if FL_38_DO == "EurGen"
replace nargroup=5 if FL_38_DO == "EurNarrGen"
replace nargroup=6 if FL_38_DO == "EuropeControl"
replace nargroup=7 if FL_38_DO == "EuropeNarr"
label define nargroup 0 "Africa Control" 1 "Africa Genocide" 2"Africa Narrative" 3"Africa Narrative Genocide" 4 "Europe Genocide" 5 "Europe Narrative Genocide" 6"Europe Control" 7"Europe Narrative"
label values nargroup nargroup 
tab nargroup 


STOP

*****************************
* Dependent Policy Measures *
*****************************

* Q9 The United States should admit Ukrainian refugees for resettlement due to the ongoing war in Europe.
* Strongly disagree  (1) 
* Disagree  (2) 
* Somewhat disagree  (3) 
* Neither agree nor disagree  (4) 
* Somewhat agree  (5) 
* Agree  (6) 
* Strongly agree  (7) 
tab Q9
gen ukraine = Q9


* Q14 Do you support or oppose legislation that would allow the federal government to negotiate with drug companies (for both Medicare and private insurance) to lower prices on necessary prescription drugs, such as insulin for diabetes?
* Strongly oppose  (1) 
* Oppose  (2) 
* Somewhat oppose  (3) 
* Neither oppose nor support  (4) 
* Somewhat support  (5) 
* Support  (6) 
* Strongly support  (7) 
tab Q14
gen drugs = Q14


* Q15 Do you support or oppose of the 2010 Affordable Care Act, also known as "Obamacare"?
* Strongly oppose  (1) 
* Oppose  (2) 
* Somewhat oppose  (3) 
* Neither oppose nor support  (4) 
* Somewhat support  (5) 
* Support  (6) 
* Strongly support  (7)
tab Q15 
gen ACA = Q15


* Q134 Inceration Felon vs. Citizens
* Randomziation Variable is FL_43_DO
tab Q134
tab Q135

gen felondis=. 
replace felondis=1 if Q134==1
replace felondis=2 if Q134==2
replace felondis=3 if Q134==3
replace felondis=4 if Q134==4
replace felondis=5 if Q134==5
replace felondis=6 if Q134==6
replace felondis=7 if Q134==7
replace felondis=1 if Q135==1
replace felondis=2 if Q135==2
replace felondis=3 if Q135==3
replace felondis=4 if Q135==4
replace felondis=5 if Q135==5
replace felondis=6 if Q135==6
replace felondis=7 if Q135==7
tab felondis

tab FL_43_DO
gen felongroup=. 
replace felongroup=0 if FL_43_DO=="FelVoteCitizen"
replace felongroup=1 if FL_43_DO=="FelVoteConvict"
tab felongroup
label define felongroup 0 "Citizen Control" 1 "EConvict"
label values felongroup felongroup
tab felongroup


* Q101 The United States should send humanitarian aid such as food, water, sanitation, and medical supplies, to alleviate human suffering in this conflict zone.
* Strongly disagree  (1) 
* Disagree  (2) 
* Somewhat disagree  (3) 
* Neither agree nor disagree  (4) 
* Somewhat agree  (5) 
* Agree  (6) 
* Strongly agree  (7) 
tab Q101
gen aid = Q101


* Q103 Genocide should be prioritized within the top 5 of U.S foreign policy concerns.
* Strongly disagree  (1) 
* Disagree  (2) 
* Somewhat disagree  (3) 
* Neither agree nor disagree  (4) 
* Somewhat agree  (5) 
* Agree  (6) 
* Strongly agree  (7) 
tab Q103
gen genocide = Q103


**************************************************
* Main Paper Figure 2: Predicted probability plots 
**************************************************

* See distribution of Empavg
hist empavg //Looks like hardly anyone aroudn 1-1.5. Start scale at 2

* Ukraine
regress ukraine empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.felongroup i.nargroup resentment i.party2#c.empavg
margins i.party2, at(empavg=(2 2.5 3 3.5 4)) vsquish
marginsplot, recast(line) recastci(rarea)  graphregion(color(white)) title ("Ukraine") xtitle("Empathy", margin(medium)) 
graph save UkraineParty2, replace


* Drug Prices
regress drugs empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.felongroup i.nargroup resentment i.party2#c.empavg
margins i.party2, at(empavg=(2 2.5 3 3.5 4)) vsquish
marginsplot, recast(line) recastci(rarea)  graphregion(color(white)) title ("Drugs") xtitle("Empathy", margin(medium)) 
graph save DrugsParty2, replace


* ACA
regress ACA empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.felongroup i.nargroup resentment i.party2#c.empavg
margins i.party2, at(empavg=(2 2.5 3 3.5 4)) vsquish
marginsplot, recast(line) recastci(rarea)  graphregion(color(white)) title ("ACA")   xtitle("Empathy", margin(medium)) 
graph save ACAParty2, replace

* Felons
regress felondis empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup i.party2#c.empavg
margins i.party2, at(empavg=(2 2.5 3 3.5 4)) vsquish
marginsplot, recast(line) recastci(rarea)  graphregion(color(white)) title ("Felons")   xtitle("Empathy", margin(medium)) 
graph save FelonsParty2, replace

* Humanitarian Aid
regress aid empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.felongroup i.nargroup resentment i.party2#c.empavg
margins i.party2, at(empavg=(2 2.5 3 3.5 4)) vsquish
marginsplot, recast(line) recastci(rarea)  graphregion(color(white)) title ("Humnaitarian Aid")   xtitle("Empathy", margin(medium)) 
graph save AidParty2, replace

* Genocide
regress genocide empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.felongroup i.nargroup resentment i.party2#c.empavg
margins i.party2, at(empavg=(2 2.5 3 3.5 4)) vsquish
marginsplot, recast(line) recastci(rarea)  graphregion(color(white)) title ("Genocide")   xtitle("Empathy", margin(medium)) 
graph save GenocideParty2, replace
 
grc1leg "ACAParty2" "FelonsParty2" "UkraineParty2" "DrugsParty2" "AidParty2" "GenocideParty2", xcommon row(2) col(3) title("Marginal Effects Panel 2") legendfrom ("GenocideParty2") 

***********************************************
* Main Paper Appendix (as they appear in order)
***********************************************

* Appendix Table 2 [Empathy Independent Effects]
eststo clear
eststo: quietly regress  ukraine empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup 
eststo: quietly regress drugs empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup 
eststo: quietly regress ACA empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup 
eststo: quietly regress felondis empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup
eststo: quietly regress aid empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup i.nargroup 
eststo: quietly regress genocide empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup i.nargroup 
esttab using AppendixTable2.rtf, se(3) b(3) title(Appendix Table 2: Study 2 Impact of Empathy on Policy Attitudes (Lucid)) nogaps star(* .1 ** .05 *** .01) scalars (r2) nonumbers compress onecell modelwidth(5) indicate (Controls = age1 1.gender1 2.gender1 3.gender1 edu 0.race5 1.race5 2.race5 3.race5 4.race5 income pk 0.felongroup 1.felongroup 0.military 1.military religious 0.nargroup 1.nargroup 2.nargroup 3.nargroup 4.nargroup 5.nargroup 6.nargroup 7.nargroup resentment) replace 

* Appendix Figure 3: Interflex Linear Marginal Effects 
xi: interflex ukraine party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(linear) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(Ukraine)
graph save iflexLUkraine, replace

xi: interflex drugs party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(linear) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(Drugs)
graph save iflexLdrugs, replace

xi: interflex ACA party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(linear) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(ACA)
graph save iflexLACA, replace

xi: interflex felondis party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(linear) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(Felony Disenfranchisement)
graph save iflexLfelondis, replace

xi: interflex aid party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(linear) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(Humanitarian Aid)
graph save iflexLaid, replace

xi: interflex genocide party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(linear) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(Genocide)
graph save iflexLgenocide, replace

graph combine iflexLACA.gph iflexLfelondis.gph iflexLUkraine.gph iflexLdrugs.gph iflexLaid.gph iflexLgenocide.gph, rows(2)

* Appendix Figure 4: Interflex Non-Linear Marginal Effects
xi: interflex ukraine party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(kernel) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(Ukraine)
graph save iflexNLUkraine, replace

xi: interflex drugs party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(kernel) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(Drugs)
graph save iflexNLdrugs, replace

xi: interflex ACA party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(kernel) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(ACA)
graph save iflexNLACA, replace

xi: interflex felondis party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(kernel) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(Felony Disenfranchisement)
graph save iflexNLfelondis, replace

xi: interflex aid party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(kernel) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(Humanitarian Aid)
graph save iflexNLaid, replace

xi: interflex genocide party2 empavg age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup, type(kernel) xd(density) ylab(Policy Support) dlab(Party) xlab(Empathy) title(Genocide)
graph save iflexNLgenocide, replace

graph combine iflexNLACA.gph iflexNLfelondis.gph iflexNLUkraine.gph iflexNLdrugs.gph iflexNLaid.gph iflexNLgenocide.gph, rows(2) title(Interflex Non-Linear Panel)

***************************************************************
* Analyses for Supplemental Materials (as they appear in order)
***************************************************************

* Sample statistics 
summarize gender1 age1 edu income race5 ideo3 

* Empathy distribution and histograms
hist empavg if party2==0, normal title(EQ Score Distribution: Democrats) 
hist empavg if party2==1, normal title(EQ Score Distribution: Republicans) 

* OLS Full results [no interaction]
eststo clear
eststo: quietly regress ukraine empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup
eststo: quietly regress drugs empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup
eststo: quietly regress ACA empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup
eststo: quietly regress felondis empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup
eststo: quietly regress aid empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup
eststo: quietly regress genocide empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup
esttab using Study2Table1Supp.rtf, se(3) b(3) title(Study 2 Effects of Empathy on Policy Attitudes, (OLS, no interaction)) nogaps star(* .1 ** .05 *** .01) scalars (r2) nonumbers compress onecell modelwidth(5) label replace

* OLS Full results with interaction
eststo clear
eststo: quietly regress ukraine empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup i.party2#c.empavg
eststo: quietly regress drugs empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup i.party2#c.empavg
eststo: quietly regress ACA empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup i.party2#c.empavg
eststo: quietly regress felondis empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.felongroup i.nargroup i.party2#c.empavg
eststo: quietly regress aid empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup i.party2#c.empavg
eststo: quietly regress genocide empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup i.party2#c.empavg
esttab using Study2Table2Supp.rtf, se(3) b(3) title(Study 2 Conditional Effects of Empathy on Policy Attitudes, (OLS, interaction with party)) nogaps star(* .1 ** .05 *** .01) scalars (r2) nonumbers compress onecell modelwidth(5) label replace

* Ordered Logit Independent Effects [no interaction]
eststo clear
eststo: quietly ologit ukraine empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup
eststo: quietly ologit drugs empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup
eststo: quietly ologit ACA empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious resentment i.nargroup i.felongroup
eststo: quietly ologit felondis empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup i.nargroup
eststo: quietly ologit aid empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup
eststo: quietly ologit genocide empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup
esttab using Study2Table3Supp.rtf, se(3) b(3) title(Study 2 Effects of Empathy on Policy Attitudes, (ordered logit, no interaction) (Lucid)) nogaps star(* .1 ** .05 *** .01) scalars (r2_p) nonumbers compress onecell modelwidth(5) label replace

* Ordered Logit with Interaction 
eststo clear
eststo: quietly ologit ukraine empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup i.party2#c.empavg
eststo: quietly ologit drugs empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup i.party2#c.empavg
eststo: quietly ologit ACA empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup i.party2#c.empavg
eststo: quietly ologit felondis empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup i.nargroup i.party2#c.empavg
eststo: quietly ologit aid empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup i.party2#c.empavg
eststo: quietly ologit genocide empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup i.party2#c.empavg
esttab using Study2Table4Supp.rtf, se(3) b(3) title(Study 2 Conditional Effects of Empathy on Policy Attitudes, (ordered logit, interaction with party) (Lucid)) nogaps star(* .1 ** .05 *** .01) scalars (r2_p) nonumbers compress onecell modelwidth(5) label replace

* Affective Polarization and Feeling Thermometers 

*Q132 Next, we'd like to get your feelings toward two groups. 51 and 100 degrees mean that you feel favorable and warm toward that group (100 is the most favorable/warmest) 0 and 49 degrees mean that you feel unfavorable and cold toward that group (0 is the most unfavorable/coldest) The 50 degree mark is if you don't feel particularly warm or cold toward the group. How do you feel toward the following:
tab Q132_1
gen FeelDem = Q132_1
tab FeelDem

tab Q132_2
gen FeelRep = Q132_2
tab FeelRep

eststo clear
eststo:regress FeelDem empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.party2#c.empavg
esttab using Study2FeelingThermRep.rtf, se(3) b(3) title(Feeling Thermometer towards Democrats (Lucid)) nogaps star(* .1 ** .05 *** .01) scalars (r2) nonumbers compress label replace
margins i.party2 , at(empavg=(1.5 2 2.5 3 3.5 4))vsquish
marginsplot, recast(line) recastci(rarea)  graphregion(color(white)) title ("Predicted Feelings For Democrats")   xtitle("Empathy", margin(medium)) ytitle("Predicted Feelings for Democrats", margin(medium))

eststo clear
eststo: regress FeelRep empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.party2#c.empavg
esttab using Study2FeelingThermDem.rtf, se(3) b(3) title(Feeling Thermometer towards Republicans (Lucid)) nogaps star(* .1 ** .05 *** .01) scalars (r2) nonumbers compress label replace
margins i.party2 , at(empavg=(1.5 2 2.5 3 3.5 4))vsquish
marginsplot, recast(line) recastci(rarea)  graphregion(color(white)) title ("Predicted Feelings For Republicans")   xtitle("Empathy", margin(medium)) ytitle("Predicted Feelings for Republicans", margin(medium))

* Mediation Analysis  

* medeff from http://fmwww.bc.edu/RePEc/bocode/m/medeff.html
* We conduct mediation analysis in two ways: (1) using generalized structural equation modeling (gsem), 
* and (2) causal mediation analysis (medeff) following Imai et al. (2010). Below we run both processes for all
* 6 policies.

* Ukrainian refugees
gsem (c.empavg <- i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (ukraine <- c.empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup)
gsem, coeflegend
nlcom _b[ukraine:empavg]*_b[empavg:1.party2]
xi: medeff(regress empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (regress ukraine empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup), mediate(empavg) treat(i.party2)

* Negotiate drug prices
gsem (c.empavg <- i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (drugs <- c.empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup)
gsem, coeflegend
nlcom _b[drugs:empavg]*_b[empavg:1.party2]
xi: medeff(regress empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (regress drugs empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup), mediate(empavg) treat(i.party2)

* ACA
rename ACA aca
gsem (c.empavg <- i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (aca <- c.empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup)
gsem, coeflegend
nlcom _b[aca:empavg]*_b[empavg:1.party2]
xi: medeff(regress empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (regress aca empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup), mediate(empavg) treat(i.party2)

* Felony disenfranchisement
gsem (c.empavg <- i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (felondis <- c.empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup)
gsem, coeflegend
nlcom _b[felondis:empavg]*_b[empavg:1.party2]
xi: medeff(regress empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (regress felondis empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup), mediate(empavg) treat(i.party2)

* Humanitarian aid
gsem (c.empavg <- i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (aid <- c.empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup)
gsem, coeflegend
nlcom _b[aid:empavg]*_b[empavg:1.party2]
xi: medeff(regress empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (regress aid empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup), mediate(empavg) treat(i.party2)

* Genocide as foreign policy priority 
gsem (c.empavg <- i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (genocide <- c.empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup)
gsem, coeflegend
nlcom _b[genocide:empavg]*_b[empavg:1.party2]
xi: medeff(regress empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup) (regress genocide empavg i.party2 age1 i.gender1 edu income pk i.military i.race5 religious i.nargroup resentment i.felongroup), mediate(empavg) treat(i.party2)


